package com.mindbook.vip.gawxchatinfo.utils.result;

public enum ResultEnum {

    SUCCESS(200),//成功
    FAIL(400),//失败
    UNAUTHORIZED(401),//认证失败（签名错误）
    NOT_FOUNT(404),//接口不存在
    INTERNAL_SERVER_ERROR(500),//服务器内部错误
    PARAMS_EMPTY(204),
    VALIDATE_PARAMS_LOST(204,"参数不存在"),


    //数据持久化操作
    DATA_ADD_SUCCESS(200,"数据添加成功"),
    DATA_UPDATE_SUCCESS(200,"数据修改完成"),
    DATA_DELETE_SUCCESS(200,"数据删除完成"),

    DATA_HANDLER_FAIL(400,"数据进行了操作,但数据未进行修改"),
    DATA_INSERT_FAIL(400,"数据插入失败"),
    DATA_UPDATE_FAIL(400,"数据修改失败"),
    DATA_DELETE_FAIL(400,"数据删除失败"),

    DATA_SELECT_EMPTY(400,"查询数据不存在"),




    SHIRO_LOGIN_SUCCESS(200,"用户登录成功"),

    //shiro异常
    SHIRO_CURRENT_USER_NOT_LOGIN(401,"用户未登录"),
    SHIRO_CREDENTITALS_EXCEPTION(400,"登录错误"),
    SHIRO_INCORRECT_CREDENTIALS_EXCEPTION(400,"密码错误"),
    SHIRO_UNSUPPORTED_TOKEN_EXCEPTION(400,"shiro身份令牌异常，不支持的身份令牌"),
    SHIRO_UNKNOWN_ACCOUNT_EXCEPTION(400,"账户不存在"),
    SHIRO_LOCKED_ACCOUNT_EXCEPTION(400,"帐号锁定"),
    SHIRO_CREDENTIALS_EXCEPTION(400,"凭据异常"),
    SHIRO_EXPIRED_CREDENTIALS_EXCEPTION(400,"过期的凭据异常"),
    SHIRO_ACCOUNT_EXCEPTION(400,"账户异常"),
    SHIRO_CONCURRENT_ACCESS_EXCEPTION(400,"不允许多地登录"),
    SHIRO_EXCESSIVE_ATTEMPTS_EXCEPTION(400,"登录次数超限"),
    SHIRO_DISABLED_ACCOUNT_EXCEOPTION(400,"用户禁用"),
    SHIRO_UNAUTHORIZED_EXCEPTION(400,"用户为校验"),
    SHIRO_UNANTHENTICATED_EXCEPTION(400,"用户未授权"),



    //wx access_token的异常
    ACCESS_TOKEN_SYSTEM_BUSY(-1,"微信系统繁忙"),
    ACCESS_TOKEN_APP_SECRET_ERROR(40001,"AppSecret 错误"),
    ACCESS_TOKEN_GRANT_TYPE_ERROR(40002,"grant_type错误"),
    ACCESS_TOKEN_APPID_ERROR(40013,"appid错误"),

    //wx phoneNumber 异常
    PHONE_NUMBER_SYSTEM_BUSY(-1,"微信系统繁忙"),
    PHONE_NUMBER_CODE_ERROR(40029,"不合法的code（code不存在、已过期或者使用过）"),


    SQL_HANDLER_NO_CHANGE(500,"数据持久化完成，但数据未改变"),

    UPLOAD_FILE_EMPTY(50001,"上传文件为空"),
    ;

    private Integer code;

    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    ResultEnum(Integer code) {
        this.code = code;
    }

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
